package com.lewis.system.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.lewis.core.annotation.Excel;
import com.lewis.core.annotation.Excel.ColumnType;
import com.lewis.core.base.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.util.Date;

/**
 * 参数配置表 sys_config
 *
 * @author Lewis
 */
@EqualsAndHashCode(callSuper = true)
@ApiModel("参数配置表 sys_config")
@Data
public class SysConfig extends BaseEntity {

	private static final long serialVersionUID = 1L;

	@ApiModelProperty(value = "参数主键")
	@Excel(name = "参数主键" , cellType = ColumnType.NUMERIC)
	@TableId(value = "id", type = IdType.AUTO)
	private Long id;

	@ApiModelProperty(value = "参数名称")
	@NotBlank(message = "参数名称不能为空")
	@Size(min = 0, max = 100, message = "参数名称不能超过100个字符")
	@Excel(name = "参数名称")
	private String configName;

	@ApiModelProperty(value = "参数键名")
	@NotBlank(message = "参数键名长度不能为空")
	@Size(min = 0, max = 100, message = "参数键名长度不能超过100个字符")
	@Excel(name = "参数键名")
	private String configKey;

	@ApiModelProperty(value = "参数键值")
	@NotBlank(message = "参数键值不能为空")
	@Size(min = 0, max = 500, message = "参数键值长度不能超过500个字符")
	@Excel(name = "参数键值")
	private String configValue;

	@ApiModelProperty(value = "系统内置（Y是 N否）")
	@Excel(name = "系统内置" , readConverterExp = "Y=是,N=否")
	private String configType;

	@ApiModelProperty(value = "创建者")
	private String createBy;

	@ApiModelProperty(value = "创建时间")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date createTime;

	@ApiModelProperty(value = "更新者")
	private String updateBy;

	@ApiModelProperty(value = "更新时间")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date updateTime;

	@ApiModelProperty(value = "备注")
	private String remark;
}
